from django.db import models
from django.utils import timezone
from apps.wards.models import Ward


# Create your models here.
class Patient(models.Model):
    name = models.CharField(max_length=30, verbose_name='姓名')
    IDCard = models.CharField(max_length=30, verbose_name='身份证号', null=True, blank=True)
    birth = models.DateField(verbose_name='出生日期', default="1970-01-01", null=True)
    gender = models.CharField(max_length=2, verbose_name='性别', default='男', null=True, blank=True)
    hospital_num = models.CharField(max_length=30, verbose_name='住院号')
    bed_num = models.CharField(max_length=20, verbose_name='床位号', default='', blank=True, null=True)
    enter_time = models.DateTimeField(verbose_name='入院时间', default=timezone.now, null=True)
    risk_level = models.CharField(max_length=3, verbose_name='地区风险等级', default='低风险', null=True)
    trip = models.CharField(max_length=30, verbose_name='行程信息', null=True)
    vaccine = models.CharField(max_length=30, verbose_name='接种疫苗', default='已接种', null=True)
    temperature = models.CharField(max_length=10, verbose_name='入院体温', default='', blank=True, null=True)
    nuclein_result = models.CharField(max_length=30, verbose_name='核酸报告结果', default='阴性',
                                      null=True)
    ward = models.ForeignKey(Ward, verbose_name='所属病区', db_constraint=False, on_delete=models.DO_NOTHING)

    class Meta:
        verbose_name = "病员"
        verbose_name_plural = verbose_name
        db_table = "patient"
